import { BasicFetchResult } from '../model/baseModel';
import { defHttp } from '@/utils/http/axios';

enum Api {
  fileInfoApi = '/fileInfo',
}

/**
 * 查询文件信息表分页
 * @author frank
 * @date 2022-03-09 16:14:30
 */
export const getfileInfoPage = (params?: any) =>
  defHttp.get<BasicFetchResult<any>>({ url: Api.fileInfoApi, params });
/**
 * 添加文件信息表
 * @author frank
 * @date 2022-03-09 16:14:30
 */
export const addfileInfo = (params?: any) => defHttp.post({ url: Api.fileInfoApi, params });
/**
 * 修改文件信息表
 * @author frank
 * @date 2022-03-09 16:14:30
 */
export const editfileInfo = (params?: any) => defHttp.post({ url: Api.fileInfoApi, params });
/**
 * 删除文件信息表
 * @author frank
 * @date 2022-03-09 16:14:30
 */
export const deletefileInfo = (id: string) =>
  defHttp.post({ url: Api.fileInfoApi, params: { id } });

/**
 * 导出文件信息表
 * @author frank
 * @date 2022-03-09 16:14:30
 */
export const exportfileInfo = (id: string) =>
  defHttp.get(
    { responseType: 'blob', url: Api.fileInfoApi + '/export', params: { id } },
    { isReturnNativeResponse: true },
  );
